package com.pingan.haofang.searchcloud.collection.dao;


import com.pingan.haofang.searchcloud.collection.domain.Collection;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * 索引Collection DAO
 *
 * @author baojie371
 * @date 17/5/2
 * @since 1.0.0
 */
public interface CollectionDao extends JpaRepository<Collection, Long> {

    List<Collection> findByStatus(int status);

    List<Collection> findByStatusNot(int status);

    List<Collection> findByIndexIdAndStatusOrderByIdDesc(long indexId, int status);

    List<Collection> findByMetaIdAndStatus(long metaId, int status);

    List<Collection> findByMetaIdAndCollectionName(long nmetaId, String collectionName);

    List<Collection> findByIndexIdAndStatus(long indexId, int status);

    List<Collection> findByIndexIdAndCollectionName(long indexId, String collectionName);

    List<Collection> findByIndexIdInAndStatus(Iterable<Long> indexIds, int status);

    List<Collection> findByCollectionName(String collectionName);

    List<Collection> findByCollectionNameIn(List<String> collectionName);

    List<Collection> findByIndexIdAndStatusIn(Long id, List<Integer> unDelStatusIds);
}
